<template>

			
		<uni-section title="" type="line">
					<view class="example">
						<!-- 基础用法，不包含校验规则 -->
						<uni-forms label-position="top">
							
							
							<uni-forms-item label="团队名称" >
								<uni-easyinput v-model="baseData.groupName" placeholder="请输入团队名称" />
							</uni-forms-item>
						
							
								<button type="primary" @click="submit()">创建团队</button>
						
						
						</uni-forms>
					</view>
				</uni-section>
			
					
				
</template>

<script>
	import store from '@/store/index.js';//需要引入store
	export default {
			data() {
				return {
					baseData: {
						userId:"",
						alertName: '',
						
						
					},
					
			
					
				}
			},
			onLoad() {
				//加载新闻通知数据
				this.baseData.userId=uni.getStorageSync("userId");
				
			},
			watch: {
			
			},
			mounted() {
			
			},
	
			methods:{
				submit(){
					var self=this;
					console.log("aaaaa"+JSON.stringify(self.$data.baseData.alertType[0]))
					let entTime=self.$data.endTime;
					if(self.$data.baseData.alertName.length>0&&self.$data.baseData.alertRemark.length>0&&self.$data.baseData.alertTime.length>0){
						var data={
							"id":self.$data.baseData.id,
							"alertName":self.$data.baseData.alertName,
							"alertRemark":self.$data.baseData.alertRemark,
							"alertTime":self.$data.baseData.alertTime,
							"alertType":self.$data.baseData.alertType[0]
							
							};
						
					
						store.dispatch('addAlertData',data).then(()=>{
							uni.showToast({
								title:"发布成功",
								icon:'none'
							})
							 setTimeout(() => {
								uni.redirectTo({
									url:"/pages/alert/alertList"
								})
							}, 1000);
							
						});
					}else{
						
					}
				},
				change(e) {
					this.single = e
					console.log('change事件:', this.single = e);
				},
				changeLog(e) {
					console.log('change事件:', e);
				},
				maskClick(e){
					console.log('maskClick事件:', e);
				}
			}
		}
</script>

<style>
	.example-body {
			background-color: #fff;
			padding: 10px;
		}
</style>